import React from 'react'
import { Switch, Route } from 'react-router-dom'
import loadable from '@loadable/component'

import './index.less'

const Comp1 = loadable(() => import(/* webpackChunkName: "comp1" */'./Comp1'))
const Comp2 = loadable(() => import(/* webpackChunkName: "comp2" */'./Comp2'))

const App = props => (
  <div>
    test!
    <Switch>
      <Route path="/comp1" component={Comp1} />
      <Route path="/comp2" component={Comp2} />
    </Switch>
  </div>
)

export default App